import java.util.Scanner;
public class Ex2 {
	
	public static void main (String[] args){
		
		Scanner sc = new Scanner(System.in);  
		int userInput = sc.nextInt(); //Getting input from user.
		int counter = 0;              //Counts the number of Prime numbers we met.
		int accumulator = 0;		  //Sums the Prime numbers thus far.
		double ans = 0;
		sc.close();
		
		for (int i = 2; i < userInput; i++){    
			if(isPrime(i)){					//If the current number is prime , we add it to the accumulator , and raise the counter by 1.
				counter = counter + 1;
				accumulator = accumulator + i;
				
//				System.out.println(i); // Note to self: for testing purposes , delete before submitting.
			}
		}
		
		ans = (double)accumulator/counter;
		System.out.println(ans);
	}
	
	public static boolean isPrime (int candidate){  //a function that checks if the input number is a prime.
		boolean ans = true;
		
		
		for (int i = 2 ; i < candidate && ans ; i++){ //Checks if the input number divides by any number below it.
			if (candidate % i == 0){				  //If not , that means that the candidate is Prime.
				ans = false;
			}
		}
		
		return ans;
	}
	
	
		


}
